package intelligentCustomer.planning;

import dev.langchain4j.model.chat.ChatLanguageModel;

/**
 * 通用步骤类
 * 处理不属于特定类型的步骤
 */
public class GenericStep implements PlanStep {
    private final String name;
    private final ChatLanguageModel model;
    private final String description;
    
    /**
     * 构造函数
     * 
     * @param description 步骤描述
     * @param model 语言模型
     */
    public GenericStep(String description, ChatLanguageModel model) {
        this.name = "通用步骤";
        this.description = description;
        this.model = model;
    }
    
    @Override
    public String getName() {
        return name;
    }
    
    @Override
    public String execute(PlanningContext context) {
        // 使用模型执行通用步骤
        String prompt = 
            "执行以下步骤：" + description + "\n" +
            "用户查询: " + context.getQuery() + "\n" +
            "意图类别: " + context.getIntent().getCategory() + "\n" +
            "请提供执行结果";
        
        return model.generate(prompt);
    }
    
    @Override
    public void adjustParameters(PlanningContext context) {
        // 通用步骤没有特定参数需要调整
    }
} 